package com.cskaoyan.singleton;

/**
 * 线程安全的懒加载（静态内部类）
 * @author stone
 * @date 2021/11/16 14:42
 */
public class MySingleton5 {

    public static MySingleton5 getInstance() {
        return Inner.getInnerInstance();
    }


    static class Inner {
        static MySingleton5 mySingleton5;
        static {
            mySingleton5 = new MySingleton5();
        }

        public static MySingleton5 getInnerInstance() {
            return mySingleton5;
        }
    }

    private MySingleton5() {
    }
}
